import java.awt.*;
import java.awt.event.*;
import java.util.*;

import javax.swing.JFrame;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import com.sun.java.swing.*;

/**
 *
 *  Clasa JxFrame extinde JFrame
 */
public class JxFrame extends JFrame
{
	/**
	 * 
	 * @param title
	 *  apeleaza constructorul implicit al clasei extinse JFrame cu parametrul title
	 *  si functiile specifice clasei
	 */
   public JxFrame(String title)
   {
      super(title);
      setCloseClick();
      setLF();
   }
   /**
    *  functia setCloseClick() creeaza un window listener ce raspunde la click pentru
    *  inchiderea ferestrei
    */
   private void setCloseClick()
   {
      //create window listener to respond to window close click
      addWindowListener(new WindowAdapter() 
       {
	    public void windowClosing(WindowEvent e) {System.exit(0);}
	    });
   }
 /**
  * functia setLF() face ca aplicatia swing sa apara in SystemLookAndFeel
  */
   private void setLF()
   {
   // Force SwingApp to come up in the System L&F
	String laf = UIManager.getSystemLookAndFeelClassName();
	try {
       UIManager.setLookAndFeel(laf);
   	 }
       catch (UnsupportedLookAndFeelException exc) 
         {System.err.println("Warning: UnsupportedLookAndFeel: " + laf);}
       catch (Exception exc) {System.err.println("Error loading " + laf + ": " + exc);
	   }
   }
}
